var gridList;
var key;
$(document).ready(function () {
    gridList = mini.get("gridList");
    init_Data();
});

function init_Data() {
    gridList.load();
}

function formatState(e) {
    switch (e.value) {
        case"1":
            return "待处理";
        case"0":
            return "已完成";
        case"2":
            return "已撤销";
    }
}

function formatOper(e) {
    var row = e.record;
    return "<a class='mini-button' hideFocus='' href='javascript:void(0)' onClick='open_Detail(\"" +row.taskUrl+ "\",\"" +row.taskTitle+ "\")'><span class='mini-button-text  mini-button-icon icon-edit'>查看详细</span></a>"
}

function open_Detail(url, title) {
    window.top.windowtab.addTab(title, url);
}

function onStateChanged(e) {
    gridList.load({"sysTask.taskState":e.value});
}
